{include file="common/head_exit"}
<!-- 设置 -->
<br>
<br>
<br>
{volist name="list" id="vo"}
<div class="col-lg-6">
    <div class="input-group">
        <span class="input-group-btn">
            <button class="btn btn-default" type="button">更改昵称</button>
        </span>
        <input type="text" class="form-control name_btn" value="{$vo.user}">
    </div>
    <br><br>
    <button type="button" class="btn btn-primary btn-lg btn-block" id="name_btn">确认修改</button>
    <!-- /input-group -->
</div>
{/volist}
<br>
<br>
<br>
<br>
<div class="col-lg-6">
    <div class="input-group">
        <span class="input-group-btn">
            <button class="btn btn-default " type="button" id="">原密码</button>
        </span>
        <input type="password" class="form-control name_pawd pawd_btn1" value="">
    </div>
    <!-- /input-group -->
</div>
<br>
<div class="col-lg-6">
    <div class="input-group">
        <span class="input-group-btn">
            <button class="btn btn-default " type="button">更改密码</button>
        </span>
        <input type="password" class="form-control pawd_btn2" value="">
    </div>
    <!-- /input-group -->
    <br>
    <button type="button" class="btn btn-primary btn-lg btn-block" id="pawd_btn">确认修改</button>
</div>

<script>
    var number = document.cookie.substring(7);
    $('#name_btn').click(function () {
         name= $('.name_btn')[0].value;
        console.log(name);      
        $.get('/meetTWO/public/index.php/index/mine/User_name_change', { id: number,name:name }, function (d) {
            console.log('成功')
        })
    })

    $('#pawd_btn').click(function () {
        pawd= $('.pawd_btn1')[0].value;
        console.log(pawd);      
        $.get('/meetTWO/public/index.php/index/mine/User_pawd_change', { id: number,pawd:pawd }, function (d) {
            if(d!=1) alert("密码错误")
            else
            {
                pawd= $('.pawd_btn2')[0].value;
                $.get('/meetTWO/public/index.php/index/mine/User_pawd_changed',{id:number,pawd:pawd},function(d){
                    alert('修改成功')
                })
            }
        })
    })

</script>